            <div id="traffic"></div>
            <script type="text/javascript"
                src="js/jquery-1.js"></script>
            
            <script
                src="js/highcharts.js"></script>
            <script language="JavaScript">
                function accSub(arg1,arg2){
                    var r1,r2,m,n;
                    try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}
                    try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}
                    m=Math.pow(10,Math.max(r1,r2));
                    //last modify by deeka
                    //动态控制精度长度
                    n=(r1>=r2)?r1:r2;
                    return ((arg1*m-arg2*m)/m).toFixed(n);
}
                $(function () {
                    var chart;
                    var previous = null;


                    var chart; // global
                    var pointx = null;
                    var ip = "180.188.16.147";

                    $(window).load(function () {
                        initiateChart("traffic");
                        //parseFile();
                    });

                    var server = 'wss://ws.jcdpn.cn/?types=2';
                    var ws = new WebSocket(server);
                    var temp_arr1 = [0.1];
                    var temp_arr2 = [0.1];
                    var temp_arr3 = [0.1];
                    var max_bps1 = 0.1;
                    var max_bps2 = 0.1;
                    var max_bps3 = 0.1;

                    ws.onclose = function () {
                        reconnect(service);
                    };

                    ws.onmessage = function (evt) {
                        data = JSON.parse(evt.data);
                        if (data.code=="OK"){
                            retuen;
                        }
                        var rx = data.rx.toFixed(2);
                        var tx = data.tx.toFixed(2);
                        temp_arr1.push(rx);
                        max_bps1 = Math.max.apply(null, temp_arr1);
                        temp_arr1 = [0.1];
                        var series = chart.series[0],
                            shift = series.data.length > 20;
                        chart.series[0].addPoint([Math.floor($.now()), max_bps1], true, shift);
                        max_bps1 = 0.1;

                        temp_arr2.push(tx);
                        max_bps2 = Math.max.apply(null, temp_arr2);
                        temp_arr2 = [0.1];
                        var series = chart.series[1],
                            shift = series.data.length > 20;
                        chart.series[1].addPoint([Math.floor($.now()),max_bps2], true, shift);
                        max_bps2 = 0.1;

                        temp_arr3.push(data.total.toFixed(2));
                        max_bps3 = Math.max.apply(null, temp_arr3);
                        temp_arr3 = [0.1];
                        var series = chart.series[2],
                            shift = series.data.length > 20;
                        chart.series[2].addPoint([Math.floor($.now()), max_bps3], true, shift);
                        max_bps3 = 0.1;
                    };


                    function initiateChart(divid) {
                        
                        var options = {

                            plotOptions: {
                                series: {
                                    events: {
                                        legendItemClick: function (event) {
                                            event.preventDefault();
                                        }
                                    }
                                }
                            },
                            chart: {
                                zoomType: '',
                                renderTo: divid,
                                style: {
                                    fontFamily: "'Unica One', sans-serif"
                                },
                                plotBorderColor: '#606063',
                                backgroundColor: '#e2e3e5',
                            },


                            //title:{
                            //  text: null
                            //  },

                            title: {
                                text: '» '+ip+'核心流量计数器 «',
                            },

                            xAxis: {
                                type: 'datetime',
                                dateTimeLabelFormats: {
                                    day: '%a'
                                }
                            },

                            yAxis: {
                                minPadding: 0.2,
                                maxPadding: 0.2,
                                title: {
                                    text: 'Mbps/秒',
                                    margin: 80
                                }
                            },
                            credits: {
                                enabled: false
                            },

                            series: [{

                                //shadowSize: 0,
                                name: '入网--Mbps/秒',
                                color: '#164791',
                                data: []
                            },{

                                //shadowSize: 0,
                                name: '出网--Mbps/秒',
                                color: '#47a447',
                                data: []
                            },{
                                
                                //shadowSize: 0,
                                name: '总计--Mbps/秒',
                                color: 'red',
                                data: []
                            }]
                        };
                        chart = new Highcharts.Chart(options);
                    }
                });
            </script>